home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
answrbok
/
2_2.lha
/
2_2
/
2_2_tst.c
< prev
next >
Wrap
Text File
|
1993-08-08
|
615b
|
31 lines
* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
* The C++ Answer Book */
* Tony Hansen */
* All rights reserved. */
include <stream.h>
include <complex.h>
omplex lsqrt(complex);
oid tst(complex c)
cout << "c=" << c << "\n";
complex d = sqrt(c);
complex dl = lsqrt(c);
cout << "sqrt(c)=" << d << "\t" << dl << "\n";
complex e = d * d;
complex el = dl * dl;
cout << "c=" << e << "\t" << el << "\n\n";
ain()
tst(complex(1, -3));
tst(complex(-3, 1));
tst(complex(3, 0));
tst(complex(0, 3));
tst(complex(-3, 0));
tst(complex(0, -3));
return 0;